package com.keste.ojt1.view.task10.syalla.bakingbean;

import javax.el.ExpressionFactory;

import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

import oracle.adf.model.binding.DCBindingContainer;

import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;

import oracle.jbo.server.ViewObjectImpl;

public class ValidationsBean {
  private BindingContainer bindings = null;
    public ValidationsBean() {
    }
    
  /**
      * This method returns the instance of BindingContainer.
      * @return BindingContainer.
      */
     private BindingContainer getBindings() {
     
         if (this.bindings == null) {
             this.bindings = (BindingContainer)getDCBindingContainer();
         }
         return bindings;
     }
    
  /**
   * generic method to get handle to DCBindingContainer.
   * @return DCBindingContainer handle
   */
  public DCBindingContainer getDCBindingContainer() {
     
      FacesContext fctx = FacesContext.getCurrentInstance();
      ExpressionFactory expFactory =
          FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
      DCBindingContainer bc =
          (DCBindingContainer)expFactory.createValueExpression(fctx.getELContext(),
                                                               "#{bindings}",
                                                               DCBindingContainer.class).getValue(fctx.getELContext());

      return bc;
  }
  


    public void validationOnRows(ActionEvent actionEvent) {
      // String s=actionEvent.getComponent().getAttributes().toString();
     // ViewObjectImpl vo = getOrderVO1();
    }
}
